package com.justnow.offer;

import java.util.Scanner;

/**
 * @author justnow
 * Created on 2020-09-01
 * Description
 * 输入
 * 10 1
 * 2
 * 输出
 * 5
 * 2，4，6，8，10都可以被2整除
 * 共5个
 *
 */
public class Solution4 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Long N = scanner.nextLong();
        int M = scanner.nextInt();
        int[] array = new int[M];
        for (int i = 0; i < M; i++) {
            array[i] = scanner.nextInt();
        }
        int count = 0;

        for (Long i = 1L; i < N + 1; i++) {
            boolean flag = false;
            for (int j = 0; j < M; j++) {
                if (flag) {
                    break;
                }
                if (i % array[j] == 0) {
                    //System.out.println(i);
                    count++;
                    flag = true;
                }

            }

        }
        System.out.println(count);
    }
}
